//package com.czh.rdm.ktorm
//
//import com.czh.rdm.ktorm.entity.User
//import com.czh.rdm.ktorm.entity.Users
//import com.czh.rdm.ktorm.entity.Users.id
//import org.ktorm.database.Database
//import org.ktorm.dsl.eq
//import org.ktorm.dsl.from
//import org.ktorm.dsl.map
//import org.ktorm.dsl.select
//import org.ktorm.entity.EntitySequence
//import org.ktorm.entity.filter
//import org.ktorm.entity.find
//import org.ktorm.entity.sequenceOf
//import java.util.Objects
//
//fun main(args: Array<String>) {
//    val datasource = Database.connect(
//        url = "jdbc:postgresql://106.52.34.38:5432/czh-test?characterEncoding=UTF-8&useSSL=false&autoReconnect=true&rewriteBatchedStatements=true",
//        driver = "org.postgresql.Driver",
//        user = "postgres",
//        password = "JtYukpuuirLP26gq"
//    )
//
////    val r1 = datasource.from(Users)
////        .select()
////        .map { row -> Users.createEntity(row) }
////    println(r1)
//
//    fun Database.users(): EntitySequence<User, Users> {
//        return sequenceOf(Users)
//    }
//
////    val r2 = datasource.users().find { it.email eq "120715979@qq.com" }
////    println(r2)
//
//    val r3 = datasource.users().find { it.id eq 2 } ?: return
//    println(r3)
//    println("------------")
//    println(Objects.equals(r3.email, ""))
//}